import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index'),
  },
  {
    path: '/',
    name: 'layout',
    component: () => import('@/layout/index'),
    redirect: '/videoLearn',
    children: [
      {
        path: 'videoLearn',
        name: 'videoLearn',
        component: () => import('@/views/videoLearn/index'),
        meta: {
          title: '视频学习',
        }
      },
      {
        path: 'theoreticalQuestion',
        name: 'theoreticalQuestion',
        component: () => import('@/views/theoreticalQuestion/index'),
        meta: {
          title: '理论题库',
        }
      },
      {
        path: 'simulatedExam',
        name: 'simulatedExam',
        component: () => import('@/views/simulatedExam/index'),
        meta: {
          title: '模拟考试',
        }
      },
      {
        path: 'examDetails',
        name: 'examDetails',
        component: () => import('@/views/exam/examDetails'),
        meta: {
          title: '考试详情',
        }
      },
      {
        path: 'wrongQuestionsAgain',
        name: 'wrongQuestionsAgain',
        component: () => import('@/views/exam/wrongQuestionsAgain'),
        meta: {
          title: '错题重练',
        }
      },
      {
        path: 'notice',
        name: 'notice',
        component: () => import('@/views/notice/index'),
        meta: {
          title: '公告列表',
        }
      },
      {
        path: 'announcementDetails',
        name: 'announcementDetails',
        component: () => import('@/views/notice/announcementDetails'),
        meta: {
          title: '公告详情',
        }
      },
    ]
  },

  {
    path: '/examManage',
    name: 'examManage',
    component: () => import('@/views/examManage/index'),
    meta: {
      title: '开始考试',
    }
  },
  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  // }
]

const router = new VueRouter({
  routes
})

export default router
